home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / PInterfaces / Folders.p < prev    next >
Encoding:
Text File  |  1998-07-17  |  12.2 KB  |  293 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Folders.p
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Folders;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __FOLDERS__}
  28. {$SETC __FOLDERS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC FoldersIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37.  
  38.  
  39. {$PUSH}
  40. {$ALIGN MAC68K}
  41. {$LibExport+}
  42.  
  43.  
  44. CONST
  45.     kOnSystemDisk                = -32768;                        {  previously was 0x8000 but that is an unsigned value whereas vRefNum is signed }
  46.  
  47.     kCreateFolder                = true;
  48.     kDontCreateFolder            = false;
  49.  
  50.     kSystemFolderType            = 'macs';                        {  the system folder  }
  51.     kDesktopFolderType            = 'desk';                        {  the desktop folder; objects in this folder show on the desk top.  }
  52.     kTrashFolderType            = 'trsh';                        {  the trash folder; objects in this folder show up in the trash  }
  53.     kWhereToEmptyTrashFolderType = 'empt';                        {  the "empty trash" folder; Finder starts empty from here down  }
  54.     kPrintMonitorDocsFolderType    = 'prnt';                        {  Print Monitor documents  }
  55.     kStartupFolderType            = 'strt';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here  }
  56.     kShutdownFolderType            = 'shdf';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here  }
  57.     kAppleMenuFolderType        = 'amnu';                        {  Finder objects to put into the Apple menu go here  }
  58.     kControlPanelFolderType        = 'ctrl';                        {  Control Panels go here (may contain INITs)  }
  59.     kExtensionFolderType        = 'extn';                        {  System extensions go here  }
  60.     kFontsFolderType            = 'font';                        {  Fonts go here  }
  61.     kPreferencesFolderType        = 'pref';                        {  preferences for applications go here  }
  62.     kTemporaryFolderType        = 'temp';                        {  temporary files go here (deleted periodically, but don't rely on it.)  }
  63.  
  64. {
  65.     Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  66.             while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  67.             Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  68. }
  69. {$IFC NOT UNDEFINED USE_FINDFOLDER_GLUE }
  70. FUNCTION FindFolder(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  71. {$ELSEC}
  72. FUNCTION FindFolder(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  73.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  74.     INLINE $7000, $A823;
  75.     {$ENDC}
  76. {$ENDC}
  77.  
  78. FUNCTION ReleaseFolder(vRefNum: INTEGER; folderType: OSType): OSErr;
  79.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  80.     INLINE $700B, $A823;
  81.     {$ENDC}
  82.  
  83. {$IFC NOT TARGET_OS_MAC }
  84. { Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  85.    the found folder path.
  86.  }
  87. FUNCTION FindFolderEx(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT; foundFolder: CStringPtr): OSErr; C;
  88. {$ENDC}
  89.  
  90. {****************************************}
  91. { Extensible Folder Manager declarations }
  92. {****************************************}
  93.  
  94. {**************************}
  95. { Folder Manager constants }
  96. {**************************}
  97.  
  98.  
  99. CONST
  100.     kExtensionDisabledFolderType = 'extD';
  101.     kControlPanelDisabledFolderType = 'ctrD';
  102.     kSystemExtensionDisabledFolderType = 'macD';
  103.     kStartupItemsDisabledFolderType = 'strD';
  104.     kShutdownItemsDisabledFolderType = 'shdD';
  105.     kApplicationsFolderType        = 'apps';
  106.     kDocumentsFolderType        = 'docs';
  107.  
  108.                                                                 {  new constants  }
  109.     kVolumeRootFolderType        = 'root';                        {  root folder of a volume  }
  110.     kChewableItemsFolderType    = 'flnt';                        {  items deleted at boot  }
  111.     kApplicationSupportFolderType = 'asup';                        {  third-party items and folders  }
  112.     kTextEncodingsFolderType    = 'ƒtex';                        {  encoding tables  }
  113.     kStationeryFolderType        = 'odst';                        {  stationery  }
  114.     kOpenDocFolderType            = 'odod';                        {  OpenDoc root  }
  115.     kOpenDocShellPlugInsFolderType = 'odsp';                    {  OpenDoc Shell Plug-Ins in OpenDoc folder  }
  116.     kEditorsFolderType            = 'oded';                        {  OpenDoc editors in MacOS Folder  }
  117.     kOpenDocEditorsFolderType    = 'ƒodf';                        {  OpenDoc subfolder of Editors folder  }
  118.     kOpenDocLibrariesFolderType    = 'odlb';                        {  OpenDoc libraries folder  }
  119.     kGenEditorsFolderType        = 'ƒedi';                        {  CKH general editors folder at root level of Sys folder  }
  120.     kHelpFolderType                = 'ƒhlp';                        {  CKH help folder currently at root of system folder  }
  121.     kInternetPlugInFolderType    = 'ƒnet';                        {  CKH internet plug ins for browsers and stuff  }
  122.     kModemScriptsFolderType        = 'ƒmod';                        {  CKH modem scripts, get 'em OUT of the Extensions folder  }
  123.     kPrinterDescriptionFolderType = 'ppdf';                        {  CKH new folder at root of System folder for printer descs.  }
  124.     kPrinterDriverFolderType    = 'ƒprd';                        {  CKH new folder at root of System folder for printer drivers  }
  125.     kScriptingAdditionsFolderType = 'ƒscr';                        {  CKH at root of system folder  }
  126.     kSharedLibrariesFolderType    = 'ƒlib';                        {  CKH for general shared libs.  }
  127.     kVoicesFolderType            = 'fvoc';                        {  CKH macintalk can live here  }
  128.     kControlStripModulesFolderType = 'sdev';                    {  CKH for control strip modules  }
  129.     kAssistantsFolderType        = 'astƒ';                        {  SJF for Assistants (MacOS Setup Assistant, etc)  }
  130.     kUtilitiesFolderType        = 'utiƒ';                        {  SJF for Utilities folder  }
  131.     kAppleExtrasFolderType        = 'aexƒ';                        {  SJF for Apple Extras folder  }
  132.     kContextualMenuItemsFolderType = 'cmnu';                    {  SJF for Contextual Menu items  }
  133.     kMacOSReadMesFolderType        = 'morƒ';                        {  SJF for MacOS ReadMes folder  }
  134.     kALMModulesFolderType        = 'walk';                        {  EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType)  }
  135.     kALMPreferencesFolderType    = 'trip';                        {  EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType)  }
  136.     kALMLocationsFolderType        = 'fall';                        {  EAS for Location Manager Locations (within kALMPreferencesFolderType)  }
  137.     kColorSyncProfilesFolderType = 'prof';                        {  for ColorSync™ Profiles  }
  138.     kThemesFolderType            = 'thme';                        {  for Theme data files  }
  139.     kFavoritesFolderType        = 'favs';                        {  Favorties folder for Navigation Services  }
  140.     kInternetFolderType            = 'intƒ';                        {  Internet folder (root level of startup volume)  }
  141.     kAppearanceFolderType        = 'appr';                        {  Appearance folder (root of system folder)  }
  142.     kSoundSetsFolderType        = 'snds';                        {  Sound Sets folder (in Appearance folder)  }
  143.     kDesktopPicturesFolderType    = 'dtpƒ';                        {  Desktop Pictures folder (in Appearance folder)  }
  144.     kInternetSearchSitesFolderType = 'issf';                    {  Internet Search Sites folder  }
  145.     kFindSupportFolderType        = 'fnds';                        {  Find support folder  }
  146.     kFindByContentFolderType    = 'fbcf';                        {  Find by content folder  }
  147.     kInstallerLogsFolderType    = 'ilgf';                        {  Installer Logs folder  }
  148.     kScriptsFolderType            = 'scrƒ';                        {  Scripts folder  }
  149.     kFolderActionsFolderType    = 'fasf';                        {  Folder Actions Scripts folder  }
  150.     kLauncherItemsFolderType    = 'laun';                        {  Launcher Items folder  }
  151.     kRecentApplicationsFolderType = 'rapp';                        {  Recent Applications folder  }
  152.     kRecentDocumentsFolderType    = 'rdoc';                        {  Recent Documents folder  }
  153.     kRecentServersFolderType    = 'rsvr';                        {  Recent Servers folder  }
  154.     kSpeakableItemsFolderType    = 'spki';                        {  Speakable Items folder  }
  155.  
  156.  
  157. { FolderDescFlags values }
  158.     kCreateFolderAtBoot            = $00000002;
  159.     kFolderCreatedInvisible        = $00000004;
  160.     kFolderCreatedNameLocked    = $00000008;
  161.  
  162.  
  163. TYPE
  164.     FolderDescFlags                        = UInt32;
  165. { FolderClass values }
  166.  
  167. CONST
  168.     kRelativeFolder                = 'relf';
  169.     kSpecialFolder                = 'spcf';
  170.  
  171.  
  172. TYPE
  173.     FolderClass                            = OSType;
  174. { special folder locations }
  175.  
  176. CONST
  177.     kBlessedFolder                = 'blsf';
  178.     kRootFolder                    = 'rotf';
  179.  
  180.  
  181. TYPE
  182.     FolderType                            = OSType;
  183.     FolderLocation                        = OSType;
  184.  
  185.     FolderDescPtr = ^FolderDesc;
  186.     FolderDesc = RECORD
  187.         descSize:                Size;
  188.         foldType:                FolderType;
  189.         flags:                    FolderDescFlags;
  190.         foldClass:                FolderClass;
  191.         foldLocation:            FolderType;
  192.         badgeSignature:            OSType;
  193.         badgeType:                OSType;
  194.         reserved:                UInt32;
  195.         name:                    StrFileName;                            {  Str63 on MacOS }
  196.     END;
  197.  
  198.  
  199.     RoutingFlags                        = UInt32;
  200.     FolderRoutingPtr = ^FolderRouting;
  201.     FolderRouting = RECORD
  202.         descSize:                Size;
  203.         fileType:                OSType;
  204.         routeFromFolder:        FolderType;
  205.         routeToFolder:            FolderType;
  206.         flags:                    RoutingFlags;
  207.     END;
  208.  
  209. { routing constants }
  210. {*************************}
  211. { Folder Manager routines }
  212. {*************************}
  213. { Folder Manager administration routines }
  214. FUNCTION AddFolderDescriptor(foldType: FolderType; flags: FolderDescFlags; foldClass: FolderClass; foldLocation: FolderLocation; badgeSignature: OSType; badgeType: OSType; name: ConstStrFileNameParam; replaceFlag: BOOLEAN): OSErr;
  215.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  216.     INLINE $7020, $A823;
  217.     {$ENDC}
  218. FUNCTION GetFolderDescriptor(foldType: FolderType; descSize: Size; VAR foldDesc: FolderDesc): OSErr;
  219.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  220.     INLINE $7023, $A823;
  221.     {$ENDC}
  222. FUNCTION GetFolderTypes(requestedTypeCount: UInt32; VAR totalTypeCount: UInt32; VAR theTypes: FolderType): OSErr;
  223.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  224.     INLINE $7024, $A823;
  225.     {$ENDC}
  226. FUNCTION RemoveFolderDescriptor(foldType: FolderType): OSErr;
  227.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  228.     INLINE $7021, $A823;
  229.     {$ENDC}
  230. { legacy routines }
  231. FUNCTION GetFolderName(vRefNum: INTEGER; foldType: OSType; VAR foundVRefNum: INTEGER; VAR name: StrFileName): OSErr;
  232.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  233.     INLINE $700E, $A823;
  234.     {$ENDC}
  235. { routing routines }
  236. FUNCTION AddFolderRouting(fileType: OSType; routeFromFolder: FolderType; routeToFolder: FolderType; flags: RoutingFlags; replaceFlag: BOOLEAN): OSErr;
  237.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  238.     INLINE $7026, $A823;
  239.     {$ENDC}
  240. FUNCTION RemoveFolderRouting(fileType: OSType; routeFromFolder: FolderType): OSErr;
  241.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  242.     INLINE $7027, $A823;
  243.     {$ENDC}
  244. FUNCTION FindFolderRouting(fileType: OSType; routeFromFolder: FolderType; VAR routeToFolder: FolderType; VAR flags: RoutingFlags): OSErr;
  245.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  246.     INLINE $7022, $A823;
  247.     {$ENDC}
  248. FUNCTION GetFolderRoutings(requestedRoutingCount: UInt32; VAR totalRoutingCount: UInt32; routingSize: Size; VAR theRoutings: FolderRouting): OSErr;
  249.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  250.     INLINE $701E, $A823;
  251.     {$ENDC}
  252. FUNCTION InvalidateFolderDescriptorCache(vRefNum: INTEGER; dirID: LONGINT): OSErr;
  253.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  254.     INLINE $7025, $A823;
  255.     {$ENDC}
  256. FUNCTION IdentifyFolder(vRefNum: INTEGER; dirID: LONGINT; VAR foldType: FolderType): OSErr;
  257.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  258.     INLINE $701F, $A823;
  259.     {$ENDC}
  260.  
  261.  
  262. CONST
  263.                                                                 {  new constants  }
  264.     kGlobalPreferencesFolderType = 'gprf';                        {  preferences for all users/workspaces  }
  265.     kSystem7SystemFolderType    = 'ƒblu';                        {  System 7 system folder  }
  266.     kDebuggerExtensionsFolderType = 'ƒdeb';                        {  debugger extensions  }
  267.     kDesktopModulesFolderType    = 'ƒdsk';                        {  desktop animation modules  }
  268.     kExtensionLibrariesFolderType = 'ƒexl';                        {  leechlets  }
  269.     kCoopExtensionLibrariesFolderType = 'ƒcex';                    {  blue leechlets  }
  270.     kHardwareSupportFolderType    = 'ƒhdw';                        {  hardware support  }
  271.     kLocalesFolderType            = 'ƒloc';                        {  locales  }
  272.     kServerLibrariesFolderType    = 'ƒser';                        {  servers  }
  273.     kSystemLibrariesFolderType    = 'ƒsys';                        {  system libraries  }
  274.     kSoundsFolderType            = 'ƒsnd';                        {  sounds  }
  275.     kVMFilesFolderType            = 'ƒvmf';                        {  temporary for DR 1 only  }
  276.                                                                 {  known FolderType values  }
  277.     kCurrentWorkspaceFolder        = 'cwsf';
  278.     kWorkspacesFolder            = 'wksf';
  279.     kSystem7BlessedFolder        = 'bls7';
  280.  
  281.  
  282.  
  283. {$ALIGN RESET}
  284. {$POP}
  285.  
  286. {$SETC UsingIncludes := FoldersIncludes}
  287.  
  288. {$ENDC} {__FOLDERS__}
  289.  
  290. {$IFC NOT UsingIncludes}
  291.  END.
  292. {$ENDC}
  293.